#ifndef CSERVERNETENGINE_H
#define CSERVERNETENGINE_H

#include <QThread>

class CConnectMsg;
class QTcpSocket;

/**
  * This is the server-side network engine. It's derived from QRunnable since we want each one of these to run in it's own
  * separate thread. It expects a connected socket - this is the communication platform with the client end - the socket
  * will be closed by the FSM before it completes.
  */
class CServerNetEngine : public QThread
{
	Q_OBJECT

public:
	CServerNetEngine(int nSocketDescriptor,
			QObject *pParent = NULL);

    void run();

protected slots:
	void onData();

private:
	void onClientConnect(CConnectMsg *pMsg);

	int m_nSocketDescriptor;
	QTcpSocket *m_pSocket;
};

#endif // CSERVERNETENGINE_H
